package com.powervision.mvvmdemo.ui.viewmodel

import com.powervision.base.base.BaseViewModel
import com.powervision.http.observer.StateLiveData
import com.powervision.mvvmdemo.ui.model.CategoryModel
import com.powervision.mvvmdemo.ui.repository.FriendRepository

/**
 * @auth: njb
 * @date: 2021/12/21 10:29
 * @desc: 描述
 */
class FriendViewModel : BaseViewModel() {
    private val mFriendRepository by lazy { FriendRepository() }

    val mFriendLiveData = StateLiveData<List<CategoryModel>>()

    fun friend() {
        launchWithLoading(
            requestBlock = {
                mFriendRepository.friend()
            }, resultCallback = {
                mFriendLiveData.value = it
            })
    }
}